/**
 *  Copyright 2010 ShenYang voole Co. Ltd.
 *  All right reserved. 
 */
package cn.piaoyi.service;

import java.util.List;
import cn.piaoyi.bean.Cart;
import cn.piaoyi.exception.PiaoyiException;

/**
 * 功能描述:购物车事务接口
 *
 * 创建日期 Apr 10, 2010
 *
 * @author zhangbaochao
 *
 * @version 1.0
 *
 */
public interface CartService {
	/**
	 * 保存Cart对象
	 * 
	 * @param cart
	 * 			Cart对象
	 * @return Cart
	 * 			Cart对象
	 */
	public Cart createCart(Cart cart) throws PiaoyiException;
	
	/**
	 * 保存Cart对象
	 * 
	 * @param cart
	 * 			Cart对象
	 * @return Cart
	 * 			Cart对象
	 */
	public Cart updateCart(Cart cart) throws PiaoyiException;
	
	/**
	 * 根据主键ID获取Cart对象
	 * 
	 * @param id
	 * 			主键ID
	 * @return Cart
	 * 			Cart对象
	 */
	public Cart findCartById(long id);
	
	/**
	 * 根据UID PID获取Cart对象
	 * @param uid
	 * 			long
	 * @param pid
	 * 			long
	 * @return Cart
	 */
	public Cart findCartByUidPid(long uid,long pid);
	
	/**
	 * 获取Price列表
	 * 
	 * @param userId
	 * 			long
	 * @param orderby
	 *            String
	 * @param ascOrDesc
	 *            int
	 * @return List
	 * 			Price对象列表
	 */
	public List findCarts(long userId,String orderby, int ascOrDesc);
	
	/**
	 * 删除Cart对象
	 */
	public void removeCartById(long id);
	
	public void removeCartInIds(List ids);
	
	public void removeCartByUid(long userId);
	
	public void removeCartAll();
}
